<div
	class="topbar-container"
	ng-include="'views/includes/topbar.html'"
	ng-init="titleSection='Sweep paper wallet (unimplemented)'; goBackToState = true;">
</div>

<div class="content preferences" ng-controller="paperWalletController as paperWallet">
	<h4 ng-show="!paperWallet.error"></h4>
	<div class="onGoingProcess" ng-show="paperWallet.scanning || paperWallet.sending">
		<div class="onGoingProcess-content">
			<div class="spinner">
				<div class="rect1"></div>
				<div class="rect2"></div>
				<div class="rect3"></div>
				<div class="rect4"></div>
				<div class="rect5"></div>
			</div>
			<span ng-show="paperWallet.scanning" translate>Scanning wallet funds...</span>
			<span ng-show="paperWallet.sending" translate>Sending funds...</span>
		</div>
	</div>
	<div class="box-notification text-warning" ng-show="paperWallet.error">
		<i class="fi-alert size-12"></i>
		<span>{{paperWallet.error|translate}}</span>
	</div>
	<form ng-show="!paperWallet.balance" class="oh">
		<div class="row">
			<div class="large-12 medium-12 columns">
				<div class="input">
					<label for="inputData" translate>Paper Wallet Private Key</label>
					<input type="text" placeholder="{{'Paste your paper wallet private key here'|translate}}" ng-model="inputData" id="inputData" ng-change="paperWallet.onData(inputData)">
					<div class="qr-scanner-input">
						<qr-scanner on-scan="paperWallet.onQrCodeScanned(data)"></qr-scanner>
					</div>
					<div ng-show="paperWallet.isPkEncrypted">
						<label for="passphrase">
							<span translate>Passphrase</span>
						</label>
						<input id="passphrase" type="password" name="passphrase" placeholder="{{'Passphrase'|translate}}" ng-model="passphrase">
						<p ng-show="index.isCordova" translate class="size-12 text-gray">
							Decrypting a paper wallet could take around 5 minutes on this device. please be patient and keep the app open.
						</p>
					</div>
					<button
						ng-disabled="paperWallet.scanning || !paperWallet.scannedKey"
						ng-style="{'background-color':index.backgroundColor}"
						class="button black round expand"
						ng-click="paperWallet.scanFunds()"
						translate>Scan Wallet Funds
					</button>
				</div>
			</div>
		</div>
	</form>
	<div ng-show="paperWallet.balance" class="row">
		<div class="large-12 medium-12 columns">
			<div class="text-center m20b">
				<h4 class="text-bold" translate>Funds found</h4>
				<div class="size-24">
					{{paperWallet.balance}}
				</div>
			</div>

			<button
				ng-disabled="paperWallet.sending || paperWallet.balanceBytes <= 0"
				ng-style="{'background-color':index.backgroundColor}"
				class="button black round expand"
				ng-click="paperWallet.sweepWallet()"
				translate>Sweep Wallet
			</button>
		</div>
	</div>
	<div class="text-center size-12 text-gray">
		<span translate>Funds will be transferred to</span>:
		<b>{{index.alias || index.walletName}}</b>
	</div>

</div>
<div class="extra-margin-bottom"></div>
